//
//  HomeWebViewController.m
//  NewPro
//
//  Created by RYX on 2019/2/13.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "HomeWebViewController.h"
#import <WebKit/WebKit.h>

@interface HomeWebViewController ()

@end

@implementation HomeWebViewController
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:YES];
    self.navigationController.navigationBar.hidden = YES;
}
- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:YES];
    self.navigationController.navigationBar.hidden = NO;
}
- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.redColor;
    self.view.autoresizesSubviews = NO;
    [self initCSS];
}
- (UIStatusBarStyle)preferredStatusBarStyle{
    return UIStatusBarStyleDefault;
}
- (void)initCSS{
    ViewHeader *header = [[ViewHeader alloc]initWithHomeTopString:self.subtitle];
    [self.view addSubview:header];
    WKWebView *webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(header.frame), SCREEN_WIDTH, SCREEN_HEIGHT - header.frame.size.height)];
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.url]];
    [webView loadRequest:request];
    [self.view addSubview:webView];
}

@end
